/**
 * 
 */
package idv.takeshi.software.productline.bookstore.domain.model.category;

import org.apache.commons.lang.Validate;

/**
 * A repository for Category.
 * @author takeshi
 *
 */
public interface CategoryRepository {
	
	/**
	 * Add a category.
	 * @param category
	 * @throws CategoryDuplicateException
	 */
	public void add(Category category) throws CategoryDuplicateException;
	
	/**
	 * Remove a category.
	 * @param category
	 */
	public void remove(Category category);
	
	/**
	 * Find a root category.
	 * @return
	 */
	public Category findRoot();
	
	/**
	 * Find a category by id.
	 * @param id
	 * @return
	 */
	public Category findById(Long id);

	/**
	 * Update a category.
	 * @param category
	 */
	public void update(Category category);

}
